<?php
/**
 * 商品模型表
 *
 * Author: lyun
 * Date: 2018/3/28
 * Created by Panxsoft.
 */
namespace App\Models\Panx;

use Illuminate\Database\Eloquent\Model;

class ProductMod extends Model
{
    protected $table = 'product_mods';

    protected  $guarded = [];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function attributes()
    {
        return $this->hasMany(Attribute::class, 'product_mod_id', 'id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function specs()
    {
        return $this->hasMany(Spec::class, 'product_mod_id', 'id');
    }

    /**
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function products()
    {
        return $this->hasMany(Product::class, 'product_mod_id', 'id');
    }
}
